package notebook.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.PopupPanel;

public class LoginPanel extends PopupPanel{
	Grid grid = new Grid(3, 3);

	public LoginPanel() {
		super(false);// autohide true
		setWidget(grid);
		setPopupPositionAndShow(new PopupPanel.PositionCallback() {
	          public void setPosition(int offsetWidth, int offsetHeight) {
	            int left = (Window.getClientWidth() - offsetWidth) / 2;
	            setPopupPosition(left, 0);
	          }
	        });
		this.setAnimationEnabled(true);
	}
	
	public void showChoice(){
		Images resources = GWT.create(Images.class);
		Image img = new Image(resources.logo());
//		img.setSize("150px", "100px");
		img.setAltText("谷歌账号登陆");
//		img.setUrlAndVisibleRect("http://www.google.com.hk/intl/zh-CN/images/logo_cn.png", Window.getClientWidth(), 0, 500, 800);
		grid.setSize("90%", "100%");
		grid.setWidget(0, 0, img);
		this.show();
	}
}
